﻿using SuperX.SuperSocket.Socket.Transfer.Server;
using System;

namespace SuperX.SuperSocket.Socket.Transfer.Client
{
    public delegate void TransferEventHandler<TEventArgs>(TEventArgs e);

    public delegate bool BTransferEventHandler<TEventArgs>(TEventArgs e);

    public class TransferStepEventArgs : EventArgs
    {
        public TransferStepEventArgs(long _TotalLen, long _TransferLen, int _CurrentPacket)
        {
            TotalLen = _TotalLen;
            TransferLen = _TransferLen;
            CurrentPacket = _CurrentPacket;
        }

        public int CurrentPacket { get; set; }

        public long TotalLen { get; set; }

        public long TransferLen { get; set; }
    }

    public class TransferErrorEventArgs : EventArgs
    {
        public TransferErrorEventArgs(Exception exception)
        {
            Exception = exception;
        }

        public Exception Exception { get; private set; }
    }

    public class TransferStartEventArgs : EventArgs
    {
        public TransferStartEventArgs(string projectId)
        {
            ProjectId = projectId;
        }

        public string ProjectId { get; private set; }
    }

    public class TransferFileNotExistEventArgs : EventArgs
    {
        public TransferFileNotExistEventArgs(string fileName)
        {
            FileName = fileName;
        }

        public string FileName { get; private set; }
    }

    public class TransferFileExistUplodingEventArgs : EventArgs
    {
        public TransferFileExistUplodingEventArgs(ServerUploadStateInfo info)
        {
            ServerUploadStateInfo = info;
        }

        public ServerUploadStateInfo ServerUploadStateInfo { get; private set; }
    }
}